<template>
  <div class="son">
    我是儿子a:{{a}}
    <button @click="add">+</button>
    <Children/>
  </div>
</template>

<script>
import Children from './Children.vue'
export default {
  components:{
    Children
  },
  setup (props,context) {
    function add(){
      context.emit('add',props.a+1)
    }
    return {
      add
    }
  },
  props:['a'],
  emit:['add']
}
</script>

<style lang="less" scoped>
</style>